-
-
Notifications
You must be signed in to change notification settings - Fork 87
Wire: fix setClock #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@facchinm However if I change your settings to:
I get closer to 400khz (357khz): EDIT: see post 8 and 9 of this thread for more info: https://forum.arduino.cc/t/i2c-setclock-does-not-appear-to-be-standard-way-to-setclock/1147122/6 |
@facchinm
|
setClock should not only allow the three values, 100kHz, 400kHz, 1Mhz. See this issue. |
clock source is fixed for RA4M1, so the rates will be wrong for C33. This will be fixed in the next commit
@mjs513 @greiman I pushed a new version of the patch which should take care of the clocks for both UNO and C33. |
@facchinm But if I use those settings 22/21 for a MPU-9250 running at 3.3v on Wire I am seeing something like 257khz Using your settings, again on wire for a MPU-9250 I am getting 294khz: Confused!!!!!! And if I move the 9250 over to Wire1 using your settings of 16/15 I am seeing that 526khz again and if I use the 22/21 settings I am seeing 416khz at 52% duty cycle. So now I am confused. Please note I do have the Micros propose PR incorporated as well as a couple of others. Thanks for working this - getting better and better. EDIT: all I did was copy and paste the updated Wire.cpp file. |
@facchinm Never one to leave enough alone: |
Wire1 has level shifters and works correctly for 3V3 devices. Wire is marginal for 3V3 devices. For 3V3 devices on Wire, the speed depends on pull-up resistance, pull-up voltage, and VCC for the RA4M1. See this. |
@facchinm - just wanted to know if there was anything else you wanted me to try with this? |
Implement CAN FD support for Portenta H33 arduino#2
@facchinm - maybe its a good idea to go ahead and incorporate the current fix (this pr) into the core. Seems to be resolve some issues people are having: https://forum.arduino.cc/t/i2c-setclock-does-not-appear-to-be-standard-way-to-setclock/1147122/19 |
As @facchinm is currently out-of-office I'll move ahead and merge this one. |
clock source is fixed for RA4M1, so the rates will be wrong for C33.
This will be fixed in the next commit